home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Herois / Codigo.Cst / 00007_Script_Claquete < prev    next >
Text File  |  1999-03-19  |  3KB  |  104 lines

  1. property spr, mem, ativo
  2. property anima, ultimoUpdate
  3. property saida, memSaida
  4.  
  5. on beginSprite me
  6.   set spr = the spriteNum of me
  7.   set anima = 0
  8.   set the visibility of sprite spr to false
  9.   set mem = the number of member "Claq1"
  10.   set memSaida = the number of member "SaidaPopUp"
  11.   set ativo to false
  12.   set saida to false
  13. end 
  14.  
  15. on cleanSprite me
  16.   chaveSaida me, false
  17. end
  18.  
  19. on chaveSaida me, liga
  20.   if saida = liga then return
  21.   set saida = liga
  22.   if saida then
  23.     if ativo then return
  24.     puppetSprite spr, true
  25.     set the member of sprite spr to member memSaida
  26.     set the visibility of sprite spr to true
  27.     set anima = 0
  28.     set ultimoUpdate = the timer
  29.     global gCritico
  30.     set gCritico = gCritico + 1
  31.   else
  32.     set the member of sprite spr to mem
  33.     set the visibility of sprite spr to false
  34.     set gCritico = gCritico - 1
  35.   end if
  36.   
  37. end
  38.  
  39. on comecaAnima me
  40.   set anima = 0
  41.   set the member of sprite spr to mem
  42.   set the visibility of sprite spr to true
  43.   set ultimoUpdate to the timer
  44.   set ativo to true
  45. end
  46.  
  47. on finalizaAnima me
  48.   set the visibility of sprite spr to false
  49.   set ativo to false
  50. end
  51.  
  52. on idleClaquete me
  53.   if ativo and the timer - ultimoUpdate > 2 then
  54.     set ultimoUpdate = the timer
  55.     set anima = anima + 1
  56.     if anima > 7 then set anima = 0
  57.     set the member of sprite spr to (mem + anima)
  58.     updateStage
  59.   end if
  60. end
  61.  
  62. on idleSprite me
  63.   global gMustUpdate
  64.   if not saida then return
  65.   
  66.   if the timer - ultimoUpdate > 30 then 
  67.     set anima = 1 - anima
  68.     set ultimoUpdate = the timer
  69.   end if
  70.   
  71.   set tmp = anima * 3
  72.   set p = point(the mouseH, the mouseV)
  73.   if inside(p,rect(285,229,320,243)) then
  74.     set tmp = tmp + 1
  75.   else if inside(p,rect(320,243,354,258)) then
  76.     set tmp = tmp + 2
  77.   end if
  78.   set tmp = tmp + memSaida
  79.   set tmp2 = the number of the member of sprite spr
  80.   if tmp <> tmp2 then
  81.     set the member of sprite spr to tmp
  82.     set gMustUpdate to true
  83.   end if
  84. end
  85.  
  86. on mouseUp me
  87.   if saida then
  88.     set p = point(the mouseH, the mouseV)
  89.     if inside(p,rect(285,229,320,243)) then
  90.       cursor 4
  91.       calculaDonde
  92.       global gPronde
  93.       set gPronde = 0
  94.       sendAllSPrites(#cleanSprite)
  95.       sendSprite 97, #chaveVisibilidade, false
  96.       puppetSprite spr, false
  97.       set the visibility of sprite spr to false
  98.       go frame "Saida"
  99.       cursor -1
  100.     else if inside(p,rect(320,243,354,258)) then
  101.       chaveSaida me, false
  102.     end if
  103.   end if
  104. end